<!DOCTYPE html>
<html lang="en" class="svg no-js">
<head>
    <meta charset="utf-8" />
    <!--[if IE ]>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
    <![endif]-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="Language" content="en">

    <title>MySQL :: MySQL 8.0 Reference Manual :: 6.2.10 Using Roles</title>
    <link rel="stylesheet" media="all" href="css/main-20190125.min.css" />
            <link rel="stylesheet" media="all" href="css/docs-20190125.min.css" />
    
    
    <link rel="stylesheet" media="print" href="css/print-20190125.min.css" />

    
    
    
    
            <link rel="contents" href="index.html" title="MySQL 8.0 Reference Manual" />
<link rel="start" href="index.html" title="MySQL 8.0 Reference Manual" />
<link rel="prev" href="reserved-users.html" title="6.2.9 Reserved Accounts" />
<link rel="next" href="account-categories.html?ff=nopfpls" title="6.2.11 Account Categories" />
<link rel="up" href="access-control.html" title="6.2 Access Control and Account Management" />

    
    <link rel="shortcut icon" href="favicon.ico" />
    <script>(function(H){ H.className=H.className.replace(/\bno-js\b/,'js') })(document.documentElement)</script>
    <script src="js/site-20181120.min.js"></script>

    
    
    
    <!--[if lt IE 9]>
        <script src="https://labs.mysql.com/common/js/polyfills/html5shiv-printshiv-3.7.2.min.js"></script>
        <script src="https://labs.mysql.com/common/js/polyfills/respond-1.4.2.min.js"></script>
    <![endif]-->
        <!--[if IE 9]>
        <style>#docs-sidebar-toc { box-sizing: content-box; }</style>
    <![endif]-->
    </head>

<body class="no-sidebar full-page dev">
<div class="page-wrapper">
    <header>

                        <a href="https://dev.mysql.com/" aria-label="Home" title="MySQL" id="l1-home-link"></a>
        
        <div id="l1-nav-container">
            <div id="l1-line1">
                <div id="l1-auth-links">
                    <a href="https://www.mysql.com/about/contact/"><b>Contact MySQL</b></a>
                    <span id="l1-contact-separator">&nbsp;|&nbsp;</span>
                    <span id="l1-contact-separator-br"><br /></span>
                                             <a href="https://dev.mysql.com/auth/login/?dest=https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F8.0%2Fen%2Froles.html">Login</a> &nbsp;|&nbsp;
                         <a href="https://dev.mysql.com/auth/register/">Register</a>
                                    </div>
                <div id="l1-lhs">
                    <div id="l1-slogan">
                        The world's most popular open source database
                    </div>
                    <div id="l1-search-box">
                        <form id="l1-search-form" method="get" action="https://www.oracle.com/search/results">
                        <input type="hidden" name="cat" value="mysql" />
                        <input type="hidden" name="Ntk" value="SI-ALL5" />
                        <input id="l1-search-input" type="search" class="icon-search" placeholder="Search" aria-label="Search" name="Ntt" />
                        </form>
                    </div>
                </div>
            </div>
            <div id="l1-line2">
                <div class="social-icons">
                    <a aria-label="Join us on Facebook" title="Join us on Facebook" href="http://www.facebook.com/mysql"><span class="icon-facebook"></span></a>
                    <a aria-label="Follow us on Twitter" title="Follow us on Twitter" href="https://twitter.com/mysql"><span class="icon-twitter"></span></a>
                    <a aria-label="Follow us on LinkedIn" title="Follow us on LinkedIn" href="https://www.linkedin.com/company/mysql"><span class="icon-linkedin"></span></a>
                    <a aria-label="Visit our YouTube channel" title="Visit our YouTube channel" href="http://www.youtube.com/mysqlchannel"><span class="icon-youtube"></span></a>
                </div>
                <ul id="l1-nav">
                    <li>
                        <a href="https://www.mysql.com/"><!-- <span class="icon-sakila"></span>  -->MySQL.com</a>
                    </li><li>
                        <a href="https://www.mysql.com/downloads/"><!-- <span class="icon-download-thin"></span>  -->Downloads</a>
                    </li><li class="active">
                        <a href="/doc/"><!-- <span class="icon-books"></span>  -->Documentation</a>
                    </li><li>
                        <a href="/"><!-- <span class="icon-code"></span>  -->Developer Zone</a>
                    </li>                </ul>
            </div>
        </div>
        <div id="sub-header">
            <div id="l2-nav-container">
                <div id="l2-nav-toggle">
                    <span class="icon-three-bars"></span>
                </div>
                                                                                        <a class="button nav-button-3" href="/"><span class="icon-code"></span> Developer Zone</a>
                                                                                                                                    <a class="button nav-button-2" href="https://www.mysql.com/downloads/"><span class="icon-download-thin"></span> Downloads</a>
                                                                                                <a class="button nav-button-1" href="https://www.mysql.com/"><span class="icon-sakila"></span> MySQL.com</a>
                                                                        <div id="l2-search-toggle">
                    <span class="icon-search"></span>
                </div>
                <div id="l2-site-icon">
                                                                                                                                                                                                    <span class="icon-books"></span>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </div>
                <div id="l1-section-title">
                    <span id="l1-section-label">
                        <a href="/doc/">Documentation</a>
                    </span>
                </div>
                <nav>
                    

<ul id="l2-nav">
            	<li class="active"><a class="active " href="/doc/refman/en/">MySQL Server</a>
    			</li>
	        	<li class=""><a  href="/doc/index-enterprise.html">MySQL Enterprise</a>
    			</li>
	        	<li class=""><a  href="/doc/workbench/en/">Workbench</a>
    			</li>
	        	<li class=""><a  href="/doc/en/mysql-innodb-cluster-userguide.html">InnoDB Cluster</a>
    			</li>
	        	<li class=""><a  href="/doc/index-cluster.html">MySQL NDB Cluster</a>
    			</li>
	        	<li class=""><a  href="/doc/index-connectors.html">Connectors</a>
    			</li>
	        	<li class=" last"><a  href="/doc/index-other.html">More</a>
    			</li>
	                        <li class="other-section"><a href="https://www.mysql.com/">MySQL.com</a></li>
                            <li class="other-section"><a href="https://www.mysql.com/downloads/">Downloads</a></li>
                                        <li class="other-section"><a href="/">Developer Zone</a></li>
            </ul>
                </nav>
            </div>
            <div id="l3-search-container"></div>
            <div id="top-orange"><span id="section-nav">Section Menu: &nbsp; </span></div>
        </div>
    </header>
        <div id="page">
                        <div role="main" id="main">

            
                
            
<div>
    <div id="docs-sidebar-toc" class="">
    <div id="docs-toc-inner">
        <div class="docs-sidebar-header" id="docs-nav-header">
            <a class="docs-show-hide-nav" id="docs-hide-nav" href="" title="Hide Sidebar" aria-label="Hide Sidebar"><span class="icon-arrow-small-left"></span></a>
            <div class="docs-nav-links">
                                    
    <a href="reserved-users.html"
        aria-label="Previous" title="Previous: Reserved Accounts"><span
        class="icon-chevron-left"></span></a>
<a href="index.html" aria-label="Start" title="Start"><span class="icon-book-open"></span></a>
        <a aria-label="Up" href="access-control.html" title="Up: Access Control and Account Management"><span class="icon-chevron-up"></span></a>
    <a href="account-categories.html" aria-label="Next"
        title="Next: Account Categories"><span
        class="icon-chevron-right"></span></a>
                            </div>
        </div>
                    
<div id="docs-sidebar-search-container">
    <div id="docs-sidebar-search-box">
        <form method="get" action="/mysql-manual/search-page">
            <input type="hidden" name="d" id="d" value="201" />
            <input type="hidden" name="p" id="p" value="1" />
            <input type="text" name="keyword" id="q" title="Search this Manual"
                value=""
                style="color: #bbb;"
                onfocus=""
                onblur="" />

            <button class="docs-sidebar-search-btn" aria-label="Search" title="Search" type="submit">
                <span class="icon-search"></span>
            </button>
        </form>
    </div>
</div>
                <div class="docs-sidebar-nav">
            <a class="docs-icon-home" href="/doc/"><span class="icon-home"></span>Documentation Home</a><hr />
            <div class="docs-sidebar-mtitle">MySQL 8.0 Reference Manual</div>
            <nav class="doctoc" id="doc-201">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="preface.html">Preface and Legal Notices</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="introduction.html">General Information</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="installing.html">Installing and Upgrading MySQL</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="tutorial.html">Tutorial</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="programs.html">MySQL Programs</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="server-administration.html">MySQL Server Administration</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-down"></span></a></div><div class="docs-sidebar-nav-link"><a href="security.html">Security</a></div></div>                        <div class="docs-submenu">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="general-security-issues.html">General Security Issues</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="security-guidelines.html">Security Guidelines</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="password-security.html">Keeping Passwords Secure</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="password-security-user.html">End-User Guidelines for Password Security</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="password-security-admin.html">Administrator Guidelines for Password Security</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="password-logging.html">Passwords and Logging</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="security-against-attack.html">Making MySQL Secure Against Attackers</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="security-options.html">Security-Related mysqld Options and Variables</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="changing-mysql-user.html">How to Run MySQL as a Normal User</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="load-data-local.html">Security Issues with LOAD DATA LOCAL</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="secure-client-programming.html">Client Programming Security Guidelines</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-down"></span></a></div><div class="docs-sidebar-nav-link"><a href="access-control.html">Access Control and Account Management</a></div></div>                        <div class="docs-submenu">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="user-names.html">Account User Names and Passwords</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="privileges-provided.html">Privileges Provided by MySQL</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="grant-tables.html">Grant Tables</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="account-names.html">Specifying Account Names</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="role-names.html">Specifying Role Names</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="connection-access.html">Access Control, Stage 1: Connection Verification</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="request-access.html">Access Control, Stage 2: Request Verification</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="creating-accounts.html">Adding Accounts, Assigning Privileges, and Dropping Accounts</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="reserved-users.html">Reserved Accounts</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link current"><a href="roles.html">Using Roles</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="account-categories.html">Account Categories</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="partial-revokes.html">Privilege Restriction Using Partial Revokes</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="privilege-changes.html">When Privilege Changes Take Effect</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="assigning-passwords.html">Assigning Account Passwords</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="password-management.html">Password Management</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="expired-password-handling.html">Server Handling of Expired Passwords</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="pluggable-authentication.html">Pluggable Authentication</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="proxy-users.html">Proxy Users</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="account-locking.html">Account Locking</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="user-resources.html">Setting Account Resource Limits</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="problems-connecting.html">Troubleshooting Problems Connecting to MySQL</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="account-activity-auditing.html">SQL-Based Account Activity Auditing</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="encrypted-connections.html">Using Encrypted Connections</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="using-encrypted-connections.html">Configuring MySQL to Use Encrypted Connections</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="creating-ssl-rsa-files.html">Creating SSL and RSA Certificates and Keys</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="creating-ssl-rsa-files-using-mysql.html">Creating SSL and RSA Certificates and Keys using MySQL</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="creating-ssl-files-using-openssl.html">Creating SSL Certificates and Keys Using openssl</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="creating-rsa-files-using-openssl.html">Creating RSA Keys Using openssl</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="ssl-libraries.html">SSL Library-Dependent Capabilities</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="building-with-encrypted-connection-support.html">Building MySQL with Support for Encrypted Connections</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="encrypted-connection-protocols-ciphers.html">Encrypted Connection Protocols and Ciphers</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="windows-and-ssh.html">Connecting to MySQL Remotely from Windows with SSH</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="security-plugins.html">Security Components and Plugins</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="authentication-plugins.html">Authentication Plugins</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="native-pluggable-authentication.html">Native Pluggable Authentication</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="sha256-pluggable-authentication.html">SHA-256 Pluggable Authentication</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="caching-sha2-pluggable-authentication.html">Caching SHA-2 Pluggable Authentication</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="cleartext-pluggable-authentication.html">Client-Side Cleartext Pluggable Authentication</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="pam-pluggable-authentication.html">PAM Pluggable Authentication</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="windows-pluggable-authentication.html">Windows Pluggable Authentication</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="ldap-pluggable-authentication.html">LDAP Pluggable Authentication</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="no-login-pluggable-authentication.html">No-Login Pluggable Authentication</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="socket-pluggable-authentication.html">Socket Peer-Credential Pluggable Authentication</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="test-pluggable-authentication.html">Test Pluggable Authentication</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="pluggable-authentication-system-variables.html">Pluggable Authentication System Variables</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="connection-control.html">The Connection-Control Plugins</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="connection-control-installation.html">Connection-Control Plugin Installation</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="connection-control-variables.html">Connection-Control System and Status Variables</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="validate-password.html">The Password Validation Component</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="validate-password-installation.html">Password Validation Component Installation and Uninstallation</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="validate-password-options-variables.html">Password Validation Options and Variables</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="validate-password-transitioning.html">Transitioning to the Password Validation Component</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="keyring.html">The MySQL Keyring</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="keyring-installation.html">Keyring Plugin Installation</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="keyring-file-plugin.html">Using the keyring_file File-Based Plugin</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="keyring-encrypted-file-plugin.html">Using the keyring_encrypted_file Keyring Plugin</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="keyring-okv-plugin.html">Using the keyring_okv KMIP Plugin</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="keyring-aws-plugin.html">Using the keyring_aws Amazon Web Services Keyring Plugin</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="keyring-key-migration.html">Migrating Keys Between Keyring Keystores</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="keyring-key-types.html">Supported Keyring Key Types</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="keyring-udfs-general-purpose.html">General-Purpose Keyring Key-Management Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="keyring-udfs-plugin-specific.html">Plugin-Specific Keyring Key-Management Functions</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="keyring-options.html">Keyring Command Options</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="keyring-system-variables.html">Keyring System Variables</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="audit-log.html">MySQL Enterprise Audit</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="audit-log-components.html">Audit Log Components</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="audit-log-installation.html">Installing or Uninstalling MySQL Enterprise Audit</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="audit-log-security.html">MySQL Enterprise Audit Security Considerations</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="audit-log-file-formats.html">Audit Log File Formats</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="audit-log-logging-configuration.html">Audit Log Logging Configuration</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="audit-log-filtering.html">Audit Log Filtering</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="audit-log-legacy-filtering.html">Legacy Mode Audit Log Filtering</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="audit-log-reference.html">Audit Log Reference</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="audit-log-restrictions.html">Audit Log Restrictions</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="audit-api-message-emit.html">The Audit Message Component</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="firewall.html">MySQL Enterprise Firewall</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="firewall-components.html">MySQL Enterprise Firewall Components</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="firewall-installation.html">Installing or Uninstalling MySQL Enterprise Firewall</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="firewall-usage.html">Using MySQL Enterprise Firewall</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="firewall-reference.html">MySQL Enterprise Firewall Reference</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable  loaded" aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="data-masking.html">MySQL Enterprise Data Masking and De-Identification</a></div></div>                        <div class="docs-submenu hidden">
                                    
    <ul>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="data-masking-components.html">MySQL Enterprise Data Masking and De-Identification Components</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="data-masking-installation.html">Installing or Uninstalling MySQL Enterprise Data Masking and De-Identification</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="data-masking-usage.html">Using MySQL Enterprise Data Masking and De-Identification</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="data-masking-reference.html">MySQL Enterprise Data Masking and De-Identification User-Defined Function Reference</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="fips-mode.html">FIPS Support</a></div></div>                    </li>
        </ul>
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="backup-and-recovery.html">Backup and Recovery</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="optimization.html">Optimization</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="language-structure.html">Language Structure</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="charset.html">Character Sets, Collations, Unicode</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="data-types.html">Data Types</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="functions.html">Functions and Operators</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="sql-syntax.html">SQL Statement Syntax</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="data-dictionary.html">MySQL Data Dictionary</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="innodb-storage-engine.html">The InnoDB Storage Engine</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="storage-engines.html">Alternative Storage Engines</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="replication.html">Replication</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="group-replication.html">Group Replication</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="mysql-shell-userguide.html">MySQL Shell</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="document-store.html">Using MySQL as a Document Store</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="mysql-innodb-cluster-userguide.html">InnoDB Cluster</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="mysql-cluster.html">MySQL NDB Cluster 8.0</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="partitioning.html">Partitioning</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="stored-objects.html">Stored Objects</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="information-schema.html">INFORMATION_SCHEMA Tables</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="performance-schema.html">MySQL Performance Schema</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="sys-schema.html">MySQL sys Schema</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="connectors-apis.html">Connectors and APIs</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="extending-mysql.html">Extending MySQL</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="mysql-enterprise.html">MySQL Enterprise Edition</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="workbench.html">MySQL Workbench</a></div></div>                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="faqs.html">MySQL 8.0 Frequently Asked Questions</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="error-handling.html">Errors, Error Codes, and Common Problems</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="restrictions.html">Restrictions and Limits</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><a class="expandable " aria-label="Subnav" href=""><span class="icon-chevron-right"></span></a></div><div class="docs-sidebar-nav-link"><a href="indexes.html">Indexes</a></div></div>                        <div class="docs-submenu hidden">
                            </div>
                    </li>
            <li>
            <div><div class="docs-sidebar-nav-icon"><span class="icon-dot"></span></div><div class="docs-sidebar-nav-link"><a href="glossary.html">MySQL Glossary</a></div></div>                    </li>
        </ul>
                            </nav>
        </div>

        
<a class="docs-sidebar-section" href=""><span class="icon-related"></span>
    <span class="text">Related Documentation</span></a>
<div class="docs-sidebar-accordian open">
    <div class="text">
        <a href="/doc/relnotes/mysql/8.0/en/">MySQL 8.0 Release Notes</a><br />
        <a href="/doc/dev/mysql-server/latest/">MySQL 8.0 Source Code Documentation</a><br />
        </div>
</div>

    <a class="docs-sidebar-section" href=""><span class="icon-download-thin"></span>
        <span class="text">
            Download
                            this Manual
                    </span>
    </a>
    <div class="docs-sidebar-accordian open">
        <div class="text">
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.pdf">PDF (US Ltr)</a>
            - 46.1Mb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.a4.pdf">PDF (A4)</a>
            - 46.1Mb<br />
                        <a href="https://downloads.mysql.com/docs/mysql-ref-manual-8.0-en-pdf-1-20190611.noarch.rpm">PDF (RPM)</a>
            - 41.5Mb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.html-chapter.tar.gz">HTML Download (TGZ)</a>
            - 10.6Mb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.html-chapter.zip">HTML Download (Zip)</a>
            - 10.6Mb<br />
                        <a href="https://downloads.mysql.com/docs/mysql-ref-manual-8.0-en-html-chapter-1-20190611.noarch.rpm">HTML Download (RPM)</a>
            - 9.1Mb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.man-gpl.tar.gz">Man Pages (TGZ)</a>
            - 220.4Kb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.man-gpl.zip">Man Pages (Zip)</a>
            - 325.8Kb<br />
                        <a href="https://downloads.mysql.com/docs/mysql-8.0.info.gz">Info (Gzip)</a>
            - 4.1Mb<br />
                        <a href="https://downloads.mysql.com/docs/mysql-8.0.info.zip">Info (Zip)</a>
            - 4.1Mb<br />
                    </div>
    </div>

<a class="docs-sidebar-section" href=""><span class="icon-book"></span>
    <span class="text">Excerpts from this Manual</span></a>
<div class="docs-sidebar-accordian">
    <div class="text">
                <a href="/doc/mysql-backup-excerpt/8.0/en/">MySQL Backup and Recovery</a><br />
                <a href="/doc/mysql-g11n-excerpt/8.0/en/">MySQL Globalization</a><br />
                <a href="/doc/mysql-infoschema-excerpt/8.0/en/">MySQL Information Schema</a><br />
                <a href="/doc/mysql-installation-excerpt/8.0/en/">MySQL Installation Guide</a><br />
                <a href="/doc/mysql-security-excerpt/8.0/en/">Security in MySQL</a><br />
                <a href="/doc/mysql-startstop-excerpt/8.0/en/">Starting and Stopping MySQL</a><br />
                <a href="/doc/mysql-linuxunix-excerpt/8.0/en/">MySQL and Linux/Unix</a><br />
                <a href="/doc/mysql-windows-excerpt/8.0/en/">MySQL and Windows</a><br />
                <a href="/doc/mysql-osx-excerpt/8.0/en/">MySQL and OS X</a><br />
                <a href="/doc/mysql-solaris-excerpt/8.0/en/">MySQL and Solaris</a><br />
                <a href="/doc/mysql-sourcebuild-excerpt/8.0/en/">Building MySQL from Source</a><br />
                <a href="/doc/mysql-reslimits-excerpt/8.0/en/">MySQL Restrictions and Limitations</a><br />
                <a href="/doc/mysql-partitioning-excerpt/8.0/en/">MySQL Partitioning</a><br />
                <a href="/doc/mysql-secure-deployment-guide/8.0/en/">MySQL Secure Deployment Guide</a><br />
                <a href="/doc/mysql-tutorial-excerpt/8.0/en/">MySQL Tutorial</a><br />
                <a href="/doc/mysql-perfschema-excerpt/8.0/en/">MySQL Performance Schema</a><br />
                <a href="/doc/mysql-replication-excerpt/8.0/en/">MySQL Replication</a><br />
                <a href="/doc/mysql-repo-excerpt/8.0/en/">Using the MySQL Yum Repository</a><br />
            </div>
</div>

        <br /><span id="wkr"><br /></span>
    </div>
    </div>

    <div id="docs-main" class="has-toc">
    <div id="docs-main-inner">

                <div class="right" id="docs-version-nav">
            <a href="" id="docs-version-nav-toggle">version 8.0
            <span class="icon-chevron-down"></span></a>
            <div id="docs-version-list">
                                                                                            <a                         class="tooltip-left"
                        data-tooltip="The page you are viewing does not exist in version 5.7.
                        This link will take you to the Table of Contents."
                                                href="/doc/refman/5.7/en/">
                        5.7
                                            </a><br />
                                                                            <a                         class="tooltip-left"
                        data-tooltip="The page you are viewing does not exist in version 5.6.
                        This link will take you to the Table of Contents."
                                                href="/doc/refman/5.6/en/">
                        5.6
                                            </a><br />
                                                                            <a                         class="tooltip-left"
                        data-tooltip="The page you are viewing does not exist in version 5.5.
                        This link will take you to the Table of Contents."
                                                href="/doc/refman/5.5/en/">
                        5.5
                                            </a><br />
                                                                        <div id="docs-version-nav-lang">
                                                                                                                                                    <a                                     class="tooltip-left"
                                    data-tooltip="The page you are viewing does not exist in version
                                    5.6 (JA).
                                    This link will take you to the Table of Contents."
                                                                        href="/doc/refman/5.6/ja/">
                                    5.6&nbsp;
                                                                            Japanese
                                                                    </a><br />
                                                                                            </div>
                            </div>
        </div>
        
        <div id="docs-show-nav" class="left hidden" style="margin-right: 15px;">
            <a class="docs-show-hide-nav" href="" aria-label="Show Sidebar"
                title="Show Sidebar"><span class="icon-arrow-small-right"></span></a>
        </div>

                        <div id="docs-breadcrumbs">
            <a href="/doc/refman/8.0/en/">MySQL 8.0 Reference Manual</a> &nbsp;/&nbsp;
                            <span id="breadcrumbs-link"><a href="" id="show-breadcrumbs">...</a> &nbsp;/&nbsp;</span>
                <span class="hidden" id="hidden-breadcrumbs">
                                                        <a href="security.html">Security</a> &nbsp;/&nbsp;
                                                            <a href="access-control.html">Access Control and Account Management</a> &nbsp;/&nbsp;
                                                                                        </span>
                                        Using Roles
                                    </div>
        
        <div id="docs-body">
        
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="roles"></a>6.2.10 Using Roles</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm139663229478848"></a><p>
      A MySQL role is a named collection of privileges. Like user
      accounts, roles can have privileges granted to and revoked from
      them.
    </p><p>
      A user account can be granted roles, which grants to the account
      the privileges associated with each role. This enables assignment
      of sets of privileges to accounts and provides a convenient
      alternative to granting individual privileges, both for
      conceptualizing desired privilege assignments and implementing
      them.
    </p><p>
      The following list summarizes role-management capabilities
      provided by MySQL:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <a class="link" href="create-role.html" title="13.7.1.2 CREATE ROLE Syntax"><code class="literal">CREATE ROLE</code></a> and
          <a class="link" href="drop-role.html" title="13.7.1.4 DROP ROLE Syntax"><code class="literal">DROP ROLE</code></a> create and remove
          roles.
        </p></li><li class="listitem"><p>
          <a class="link" href="grant.html" title="13.7.1.6 GRANT Syntax"><code class="literal">GRANT</code></a> and
          <a class="link" href="revoke.html" title="13.7.1.8 REVOKE Syntax"><code class="literal">REVOKE</code></a> assign privileges to
          revoke privileges from user accounts and roles.
        </p></li><li class="listitem"><p>
          <a class="link" href="show-grants.html" title="13.7.6.21 SHOW GRANTS Syntax"><code class="literal">SHOW GRANTS</code></a> displays privilege
          and role assignments for user accounts and roles.
        </p></li><li class="listitem"><p>
          <a class="link" href="set-default-role.html" title="13.7.1.9 SET DEFAULT ROLE Syntax"><code class="literal">SET DEFAULT ROLE</code></a> specifies
          which account roles are active by default.
        </p></li><li class="listitem"><p>
          <a class="link" href="set-role.html" title="13.7.1.11 SET ROLE Syntax"><code class="literal">SET ROLE</code></a> changes the active
          roles within the current session.
        </p></li><li class="listitem"><p>
          The <a class="link" href="information-functions.html#function_current-role"><code class="literal">CURRENT_ROLE()</code></a> function
          displays the active roles within the current session.
        </p></li><li class="listitem"><p>
          The <a class="link" href="server-system-variables.html#sysvar_mandatory_roles"><code class="literal">mandatory_roles</code></a> and
          <a class="link" href="server-system-variables.html#sysvar_activate_all_roles_on_login"><code class="literal">activate_all_roles_on_login</code></a>
          system variables enable defining mandatory roles and automatic
          activation of granted roles when users log in to the server.
</p></li></ul>
</div>
<p>
      For descriptions of individual role-manipulation statements
      (including the privileges required to use them), see
      <a class="xref" href="account-management-sql.html" title="13.7.1 Account Management Statements">Section 13.7.1, “Account Management Statements”</a>. The following discussion
      provides examples of role usage. Unless otherwise specified, SQL
      statements shown here should be executed using a MySQL account
      with sufficient administrative privileges, such as the
      <code class="literal">root</code> account.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="roles.html#roles-creating-granting" title="Creating Roles and Granting Privileges to Them">Creating Roles and Granting Privileges to Them</a></p></li><li class="listitem"><p><a class="xref" href="roles.html#mandatory-roles" title="Defining Mandatory Roles">Defining Mandatory Roles</a></p></li><li class="listitem"><p><a class="xref" href="roles.html#roles-checking" title="Checking Role Privileges">Checking Role Privileges</a></p></li><li class="listitem"><p><a class="xref" href="roles.html#roles-activating" title="Activating Roles">Activating Roles</a></p></li><li class="listitem"><p><a class="xref" href="roles.html#roles-revoking" title="Revoking Roles or Role Privileges">Revoking Roles or Role Privileges</a></p></li><li class="listitem"><p><a class="xref" href="roles.html#roles-dropping" title="Dropping Roles">Dropping Roles</a></p></li><li class="listitem"><p><a class="xref" href="roles.html#role-user-interchangeability" title="User and Role Interchangeability">User and Role Interchangeability</a></p></li></ul>
</div>

<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h4 class="title"><a name="roles-creating-granting"></a>Creating Roles and Granting Privileges to Them</h4>

</div>

</div>

</div>
<p>
        Consider this scenario:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            An application uses a database named
            <code class="literal">app_db</code>.
          </p></li><li class="listitem"><p>
            Associated with the application, there can be accounts for
            developers who create and maintain the application, and for
            users who interact with it.
          </p></li><li class="listitem"><p>
            Developers need full access to the database. Some users need
            only read access, others need read/write access.
</p></li></ul>
</div>
<p>
        To avoid granting privileges individually to possibly many user
        accounts, create roles as names for the required privilege sets.
        This makes it easy to grant the required privileges to user
        accounts, by granting the appropriate roles.
      </p><p>
        To create the roles, use the <a class="link" href="create-role.html" title="13.7.1.2 CREATE ROLE Syntax"><code class="literal">CREATE
        ROLE</code></a> statement:
      </p><pre class="programlisting copytoclipboard line-numbers language-sql one-line"><code class="language-sql">CREATE ROLE 'app_developer', 'app_read', 'app_write';</code></pre><p>
        Role names are much like user account names and consist of a
        user part and host part in
        <code class="literal">'<em class="replaceable"><code>user_name</code></em>'@'<em class="replaceable"><code>host_name</code></em>'</code>
        format. The host part, if omitted, defaults to
        <code class="literal">'%'</code>. The user and host parts can be unquoted
        unless they contain special characters such as
        <code class="literal">-</code> or <code class="literal">%</code>. Unlike account
        names, the user part of role names cannot be blank. For
        additional information, see <a class="xref" href="role-names.html" title="6.2.5 Specifying Role Names">Section 6.2.5, “Specifying Role Names”</a>.
      </p><p>
        To assign privileges to the roles, execute
        <a class="link" href="grant.html" title="13.7.1.6 GRANT Syntax"><code class="literal">GRANT</code></a> statements using the same
        syntax as for assigning privileges to user accounts:
      </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">GRANT ALL ON app_db.* TO 'app_developer';
GRANT SELECT ON app_db.* TO 'app_read';
GRANT INSERT, UPDATE, DELETE ON app_db.* TO 'app_write';</code></pre><p>
        Now suppose that initially you require one developer account,
        two user accounts that need read-only access, and one user
        account that needs read/write access. Use
        <a class="link" href="create-user.html" title="13.7.1.3 CREATE USER Syntax"><code class="literal">CREATE USER</code></a> to create the
        accounts:
      </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">CREATE USER 'dev1'@'localhost' IDENTIFIED BY 'dev1pass';
CREATE USER 'read_user1'@'localhost' IDENTIFIED BY 'read_user1pass';
CREATE USER 'read_user2'@'localhost' IDENTIFIED BY 'read_user2pass';
CREATE USER 'rw_user1'@'localhost' IDENTIFIED BY 'rw_user1pass';</code></pre><p>
        To assign each user account its required privileges, you could
        use <a class="link" href="grant.html" title="13.7.1.6 GRANT Syntax"><code class="literal">GRANT</code></a> statements of the same
        form as just shown, but that requires enumerating individual
        privileges for each user. Instead, use an alternative
        <a class="link" href="grant.html" title="13.7.1.6 GRANT Syntax"><code class="literal">GRANT</code></a> syntax that permits
        granting roles rather than privileges:
      </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">GRANT 'app_developer' TO 'dev1'@'localhost';
GRANT 'app_read' TO 'read_user1'@'localhost', 'read_user2'@'localhost';
GRANT 'app_read', 'app_write' TO 'rw_user1'@'localhost';</code></pre><p>
        The <a class="link" href="grant.html" title="13.7.1.6 GRANT Syntax"><code class="literal">GRANT</code></a> statement for the
        <code class="literal">rw_user1</code> account grants the read and write
        roles, which combine to provide the required read and write
        privileges.
      </p><p>
        The <a class="link" href="grant.html" title="13.7.1.6 GRANT Syntax"><code class="literal">GRANT</code></a> syntax for granting
        roles to an account differs from the syntax for granting
        privileges: There is an <code class="literal">ON</code> clause to assign
        privileges, whereas there is no <code class="literal">ON</code> clause to
        assign roles. Because the syntaxes are distinct, you cannot mix
        assigning privileges and roles in the same statement. (It is
        permitted to assign both privileges and roles to an account, but
        you must use separate <a class="link" href="grant.html" title="13.7.1.6 GRANT Syntax"><code class="literal">GRANT</code></a>
        statements, each with syntax appropriate to what is to be
        granted.) As of MySQL 8.0.16, roles cannot be granted to
        anonymous users.
      </p><p>
        A role when created is locked, has no password, and is assigned
        the default authentication plugin. (These role attributes can be
        changed later with the <a class="link" href="alter-user.html" title="13.7.1.1 ALTER USER Syntax"><code class="literal">ALTER USER</code></a>
        statement, by users who have the global
        <a class="link" href="privileges-provided.html#priv_create-user"><code class="literal">CREATE USER</code></a> privilege.)
      </p><p>
        While locked, a role cannot be used to authenticate to the
        server. If unlocked, a role can be used to authenticate. This is
        because roles and users are both authorization identifiers with
        much in common and little to distinguish them. See also
        <a class="xref" href="roles.html#role-user-interchangeability" title="User and Role Interchangeability">User and Role Interchangeability</a>.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="mandatory-roles"></a>Defining Mandatory Roles</h4>

</div>

</div>

</div>
<p>
        It is possible to specify roles as mandatory by naming them in
        the value of the
        <a class="link" href="server-system-variables.html#sysvar_mandatory_roles"><code class="literal">mandatory_roles</code></a> system
        variable. The server treats a mandatory role as granted to all
        users, so that it need not be granted explicitly to any account.
      </p><p>
        To specify mandatory roles at server startup, define
        <a class="link" href="server-system-variables.html#sysvar_mandatory_roles"><code class="literal">mandatory_roles</code></a> in your server
        <code class="filename">my.cnf</code> file:
      </p><pre class="programlisting copytoclipboard line-numbers language-ini"><code class="language-ini">[mysqld]
mandatory_roles='role1,role2@localhost,r3@%.example.com'</code></pre><p>
        To set and persist
        <a class="link" href="server-system-variables.html#sysvar_mandatory_roles"><code class="literal">mandatory_roles</code></a> at runtime, use
        a statement like this:
      </p><pre class="programlisting copytoclipboard line-numbers language-sql one-line"><code class="language-sql">SET PERSIST mandatory_roles = 'role1,role2@localhost,r3@%.example.com';</code></pre><p>
        <a class="link" href="set-variable.html" title="13.7.5.1 SET Syntax for Variable Assignment"><code class="literal">SET
        PERSIST</code></a> sets the value for the running MySQL instance.
        It also saves the value, causing it to be used for subsequent
        server restarts. To change the value for the running MySQL
        instance without saving it for subsequent restarts, use the
        <code class="literal">GLOBAL</code> keyword rather than
        <code class="literal">PERSIST</code>. See <a class="xref" href="set-variable.html" title="13.7.5.1 SET Syntax for Variable Assignment">Section 13.7.5.1, “SET Syntax for Variable Assignment”</a>.
      </p><p>
        Setting <a class="link" href="server-system-variables.html#sysvar_mandatory_roles"><code class="literal">mandatory_roles</code></a>
        requires the <a class="link" href="privileges-provided.html#priv_role-admin"><code class="literal">ROLE_ADMIN</code></a>
        privilege, in addition to the
        <a class="link" href="privileges-provided.html#priv_system-variables-admin"><code class="literal">SYSTEM_VARIABLES_ADMIN</code></a> or
        <a class="link" href="privileges-provided.html#priv_super"><code class="literal">SUPER</code></a> privilege normally required
        to set a global system variable.
      </p><p>
        Mandatory roles, like explicitly granted roles, do not take
        effect until activated (see <a class="xref" href="roles.html#roles-activating" title="Activating Roles">Activating Roles</a>).
        At login time, role activation occurs for all granted roles if
        the <a class="link" href="server-system-variables.html#sysvar_activate_all_roles_on_login"><code class="literal">activate_all_roles_on_login</code></a>
        system variable is enabled, or for roles that are set as default
        roles otherwise. At runtime, <a class="link" href="set-role.html" title="13.7.1.11 SET ROLE Syntax"><code class="literal">SET
        ROLE</code></a> activates roles.
      </p><p>
        Roles named in the value of
        <a class="link" href="server-system-variables.html#sysvar_mandatory_roles"><code class="literal">mandatory_roles</code></a> cannot be
        revoked with <a class="link" href="revoke.html" title="13.7.1.8 REVOKE Syntax"><code class="literal">REVOKE</code></a> or dropped
        with <a class="link" href="drop-role.html" title="13.7.1.4 DROP ROLE Syntax"><code class="literal">DROP ROLE</code></a> or
        <a class="link" href="drop-user.html" title="13.7.1.5 DROP USER Syntax"><code class="literal">DROP USER</code></a>.
      </p><p>
        To prevent sessions from being made system sessions by default,
        a role that has the <a class="link" href="privileges-provided.html#priv_system-user"><code class="literal">SYSTEM_USER</code></a>
        privilege cannot be listed in the value of the
        <a class="link" href="server-system-variables.html#sysvar_mandatory_roles"><code class="literal">mandatory_roles</code></a> system
        variable:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            If <a class="link" href="server-system-variables.html#sysvar_mandatory_roles"><code class="literal">mandatory_roles</code></a> is
            assigned a role at startup that has the
            <a class="link" href="privileges-provided.html#priv_system-user"><code class="literal">SYSTEM_USER</code></a> privilege, the
            server writes a message to the error log and exits.
          </p></li><li class="listitem"><p>
            If <a class="link" href="server-system-variables.html#sysvar_mandatory_roles"><code class="literal">mandatory_roles</code></a> is
            assigned a role at runtime that has the
            <a class="link" href="privileges-provided.html#priv_system-user"><code class="literal">SYSTEM_USER</code></a> privilege, an
            error occurs and the
            <a class="link" href="server-system-variables.html#sysvar_mandatory_roles"><code class="literal">mandatory_roles</code></a> value
            remains unchanged.
</p></li></ul>
</div>
<p>
        If a role named in
        <a class="link" href="server-system-variables.html#sysvar_mandatory_roles"><code class="literal">mandatory_roles</code></a> is not present
        in the <code class="literal">mysql.user</code> system table, the role is
        not granted to users. When the server attempts role activation
        for a user, it does not treat the nonexistent role as mandatory
        and writes a warning to the error log. If the role is created
        later and thus becomes valid, <a class="link" href="flush.html#flush-privileges"><code class="literal">FLUSH
        PRIVILEGES</code></a> may be necessary to cause the server to
        treat it as mandatory.
      </p><p>
        <a class="link" href="show-grants.html" title="13.7.6.21 SHOW GRANTS Syntax"><code class="literal">SHOW GRANTS</code></a> displays mandatory
        roles according to the rules described in
        <a class="xref" href="show-grants.html" title="13.7.6.21 SHOW GRANTS Syntax">Section 13.7.6.21, “SHOW GRANTS Syntax”</a>.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="roles-checking"></a>Checking Role Privileges</h4>

</div>

</div>

</div>
<p>
        To verify the privileges assigned to an account, use
        <a class="link" href="show-grants.html" title="13.7.6.21 SHOW GRANTS Syntax"><code class="literal">SHOW GRANTS</code></a>. For example:
      </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SHOW GRANTS FOR 'dev1'@'localhost';
+-------------------------------------------------+
| Grants for dev1@localhost                       |
+-------------------------------------------------+
| GRANT USAGE ON *.* TO `dev1`@`localhost`        |
| GRANT `app_developer`@`%` TO `dev1`@`localhost` |
+-------------------------------------------------+</code></pre><p>
        However, that shows each granted role without
        <span class="quote">“<span class="quote">expanding</span>”</span> it to the privileges the role
        represents. To show role privileges as well, add a
        <code class="literal">USING</code> clause naming the granted roles for
        which to display privileges:
      </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SHOW GRANTS FOR 'dev1'@'localhost' USING 'app_developer';
+----------------------------------------------------------+
| Grants for dev1@localhost                                |
+----------------------------------------------------------+
| GRANT USAGE ON *.* TO `dev1`@`localhost`                 |
| GRANT ALL PRIVILEGES ON `app_db`.* TO `dev1`@`localhost` |
| GRANT `app_developer`@`%` TO `dev1`@`localhost`          |
+----------------------------------------------------------+</code></pre><p>
        Verify each other type of user similarly:
      </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SHOW GRANTS FOR 'read_user1'@'localhost' USING 'app_read';
+--------------------------------------------------------+
| Grants for read_user1@localhost                        |
+--------------------------------------------------------+
| GRANT USAGE ON *.* TO `read_user1`@`localhost`         |
| GRANT SELECT ON `app_db`.* TO `read_user1`@`localhost` |
| GRANT `app_read`@`%` TO `read_user1`@`localhost`       |
+--------------------------------------------------------+
mysql&gt; SHOW GRANTS FOR 'rw_user1'@'localhost' USING 'app_read', 'app_write';
+------------------------------------------------------------------------------+
| Grants for rw_user1@localhost                                                |
+------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `rw_user1`@`localhost`                                 |
| GRANT SELECT, INSERT, UPDATE, DELETE ON `app_db`.* TO `rw_user1`@`localhost` |
| GRANT `app_read`@`%`,`app_write`@`%` TO `rw_user1`@`localhost`               |
+------------------------------------------------------------------------------+</code></pre><p>
        <a class="link" href="show-grants.html" title="13.7.6.21 SHOW GRANTS Syntax"><code class="literal">SHOW GRANTS</code></a> displays mandatory
        roles according to the rules described in
        <a class="xref" href="show-grants.html" title="13.7.6.21 SHOW GRANTS Syntax">Section 13.7.6.21, “SHOW GRANTS Syntax”</a>.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="roles-activating"></a>Activating Roles</h4>

</div>

</div>

</div>
<p>
        Roles granted to a user account can be active or inactive within
        account sessions. If a granted role is active within a session,
        its privileges apply; otherwise, they do not. To determine which
        roles are active within the current session, use the
        <a class="link" href="information-functions.html#function_current-role"><code class="literal">CURRENT_ROLE()</code></a> function.
      </p><p>
        By default, granting a role to an account or naming it in the
        <a class="link" href="server-system-variables.html#sysvar_mandatory_roles"><code class="literal">mandatory_roles</code></a> system variable
        value does not automatically cause the role to become active
        within account sessions. For example, because thus far in the
        preceding discussion no <code class="literal">rw_user1</code> roles have
        been activated, if you connect to the server as
        <code class="literal">rw_user1</code> and invoke the
        <a class="link" href="information-functions.html#function_current-role"><code class="literal">CURRENT_ROLE()</code></a> function, the
        result is <code class="literal">NONE</code> (no active roles):
      </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT CURRENT_ROLE();
+----------------+
| CURRENT_ROLE() |
+----------------+
| NONE           |
+----------------+</code></pre><p>
        To specify which roles should become active each time a user
        connects to the server and authenticates, use
        <a class="link" href="set-default-role.html" title="13.7.1.9 SET DEFAULT ROLE Syntax"><code class="literal">SET DEFAULT ROLE</code></a>. To set the
        default to all assigned roles for each account created earlier,
        use this statement:
      </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">SET DEFAULT ROLE ALL TO
  'dev1'@'localhost',
  'read_user1'@'localhost',
  'read_user2'@'localhost',
  'rw_user1'@'localhost';</code></pre><p>
        Now if you connect as <code class="literal">rw_user1</code>, the initial
        value of <a class="link" href="information-functions.html#function_current-role"><code class="literal">CURRENT_ROLE()</code></a> reflects
        the new default role assignments:
      </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SELECT CURRENT_ROLE();
+--------------------------------+
| CURRENT_ROLE()                 |
+--------------------------------+
| `app_read`@`%`,`app_write`@`%` |
+--------------------------------+</code></pre><p>
        To cause all explicitly granted and mandatory roles to be
        automatically activated when users connect to the server, enable
        the <a class="link" href="server-system-variables.html#sysvar_activate_all_roles_on_login"><code class="literal">activate_all_roles_on_login</code></a>
        system variable. By default, automatic role activation is
        disabled.
      </p><p>
        Within a session, a user can execute <a class="link" href="set-role.html" title="13.7.1.11 SET ROLE Syntax"><code class="literal">SET
        ROLE</code></a> to change the set of active roles. For example,
        for <code class="literal">rw_user1</code>:
      </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SET ROLE NONE; SELECT CURRENT_ROLE();
+----------------+
| CURRENT_ROLE() |
+----------------+
| NONE           |
+----------------+
mysql&gt; SET ROLE ALL EXCEPT 'app_write'; SELECT CURRENT_ROLE();
+----------------+
| CURRENT_ROLE() |
+----------------+
| `app_read`@`%` |
+----------------+
mysql&gt; SET ROLE DEFAULT; SELECT CURRENT_ROLE();
+--------------------------------+
| CURRENT_ROLE()                 |
+--------------------------------+
| `app_read`@`%`,`app_write`@`%` |
+--------------------------------+</code></pre><p>
        The first <a class="link" href="set-role.html" title="13.7.1.11 SET ROLE Syntax"><code class="literal">SET ROLE</code></a> statement
        deactivates all roles. The second makes
        <code class="literal">rw_user1</code> effectively read only. The third
        restores the default roles.
      </p><a class="indexterm" name="idm139663229323040"></a><a class="indexterm" name="idm139663229321552"></a><a class="indexterm" name="idm139663229320064"></a><a class="indexterm" name="idm139663229318576"></a><p>
        The effective user for stored program and view objects is
        subject to the <code class="literal">DEFINER</code> and <code class="literal">SQL
        SECURITY</code> attributes, which determine whether execution
        occurs in invoker or definer context (see
        <a class="xref" href="stored-objects-security.html" title="24.6 Stored Object Access Control">Section 24.6, “Stored Object Access Control”</a>):
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Stored program and view objects that execute in invoker
            context execute with the roles that are active within the
            current session.
          </p></li><li class="listitem"><p>
            Stored program and view objects that execute in definer
            context execute with the default roles of the user named in
            their <code class="literal">DEFINER</code> attribute. If
            <a class="link" href="server-system-variables.html#sysvar_activate_all_roles_on_login"><code class="literal">activate_all_roles_on_login</code></a>
            is enabled, such objects execute with all roles granted to
            the <code class="literal">DEFINER</code> user, including mandatory
            roles. For stored programs, if execution should occur with
            roles different from the default, the program body should
            execute <a class="link" href="set-role.html" title="13.7.1.11 SET ROLE Syntax"><code class="literal">SET ROLE</code></a> to activate
            the required roles.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="roles-revoking"></a>Revoking Roles or Role Privileges</h4>

</div>

</div>

</div>
<p>
        Just as roles can be granted to an account, they can be revoked
        from an account:
      </p><pre class="programlisting copytoclipboard line-numbers language-sql one-line"><code class="language-sql">REVOKE <em class="replaceable">role</em> FROM <em class="replaceable">user</em>;</code></pre><p>
        Roles named in the
        <a class="link" href="server-system-variables.html#sysvar_mandatory_roles"><code class="literal">mandatory_roles</code></a> system variable
        value cannot be revoked.
      </p><p>
        <a class="link" href="revoke.html" title="13.7.1.8 REVOKE Syntax"><code class="literal">REVOKE</code></a> can also be applied to a
        role to modify the privileges granted to it. This affects not
        only the role itself, but any account granted that role. Suppose
        that you want to temporarily make all application users read
        only. To do this, use <a class="link" href="revoke.html" title="13.7.1.8 REVOKE Syntax"><code class="literal">REVOKE</code></a> to
        revoke the modification privileges from the
        <code class="literal">app_write</code> role:
      </p><pre class="programlisting copytoclipboard line-numbers language-sql one-line"><code class="language-sql">REVOKE INSERT, UPDATE, DELETE ON app_db.* FROM 'app_write';</code></pre><p>
        As it happens, that leaves the role with no privileges at all,
        as can be seen using <a class="link" href="show-grants.html" title="13.7.6.21 SHOW GRANTS Syntax"><code class="literal">SHOW GRANTS</code></a>
        (which demonstrates that this statement can be used with roles,
        not just users):
      </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SHOW GRANTS FOR 'app_write';
+---------------------------------------+
| Grants for app_write@%                |
+---------------------------------------+
| GRANT USAGE ON *.* TO `app_write`@`%` |
+---------------------------------------+</code></pre><p>
        Because revoking privileges from a role affects the privileges
        for any user who is assigned the modified role,
        <code class="literal">rw_user1</code> now has no table modification
        privileges (<a class="link" href="privileges-provided.html#priv_insert"><code class="literal">INSERT</code></a>,
        <a class="link" href="privileges-provided.html#priv_update"><code class="literal">UPDATE</code></a>, and
        <a class="link" href="privileges-provided.html#priv_delete"><code class="literal">DELETE</code></a> are no longer present):
      </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SHOW GRANTS FOR 'rw_user1'@'localhost'
       USING 'app_read', 'app_write';
+----------------------------------------------------------------+
| Grants for rw_user1@localhost                                  |
+----------------------------------------------------------------+
| GRANT USAGE ON *.* TO `rw_user1`@`localhost`                   |
| GRANT SELECT ON `app_db`.* TO `rw_user1`@`localhost`           |
| GRANT `app_read`@`%`,`app_write`@`%` TO `rw_user1`@`localhost` |
+----------------------------------------------------------------+</code></pre><p>
        In effect, the <code class="literal">rw_user1</code> read/write user has
        become a read-only user. This also occurs for any other accounts
        that are granted the <code class="literal">app_write</code> role,
        illustrating how use of roles makes it unnecessary to modify
        privileges for individual accounts.
      </p><p>
        To restore modification privileges to the role, simply re-grant
        them:
      </p><pre class="programlisting copytoclipboard line-numbers language-sql one-line"><code class="language-sql">GRANT INSERT, UPDATE, DELETE ON app_db.* TO 'app_write';</code></pre><p>
        Now <code class="literal">rw_user1</code> again has modification
        privileges, as do any other accounts granted the
        <code class="literal">app_write</code> role.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="roles-dropping"></a>Dropping Roles</h4>

</div>

</div>

</div>
<p>
        To drop roles, use <a class="link" href="drop-role.html" title="13.7.1.4 DROP ROLE Syntax"><code class="literal">DROP ROLE</code></a>:
      </p><pre class="programlisting copytoclipboard line-numbers language-sql one-line"><code class="language-sql">DROP ROLE 'app_read', 'app_write';</code></pre><p>
        Dropping a role revokes it from every account to which it was
        granted.
      </p><p>
        Roles named in the
        <a class="link" href="server-system-variables.html#sysvar_mandatory_roles"><code class="literal">mandatory_roles</code></a> system variable
        value cannot be dropped.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="role-user-interchangeability"></a>User and Role Interchangeability</h4>

</div>

</div>

</div>
<p>
        As has been hinted at earlier for <a class="link" href="show-grants.html" title="13.7.6.21 SHOW GRANTS Syntax"><code class="literal">SHOW
        GRANTS</code></a>, which displays grants for user accounts or
        roles, accounts and roles can be used interchangeably.
      </p><p>
        One difference between roles and users is that
        <a class="link" href="create-role.html" title="13.7.1.2 CREATE ROLE Syntax"><code class="literal">CREATE ROLE</code></a> creates an
        authorization identifier that is locked by default, whereas
        <a class="link" href="create-user.html" title="13.7.1.3 CREATE USER Syntax"><code class="literal">CREATE USER</code></a> creates an
        authorization identifier that is unlocked by default. However,
        distinction is not immutable because a user with appropriate
        privileges can lock or unlock roles or users after they have
        been created.
      </p><p>
        If a database administrator has a preference that a specific
        authorization identifier must be a role, a name scheme can be
        used to communicate this intention. For example, you could use a
        <code class="literal">r_</code> prefix for all authorization identifiers
        that you intend to be roles and nothing else.
      </p><p>
        Another difference between roles and users lies in the
        privileges available for administering them:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            The <a class="link" href="privileges-provided.html#priv_create-role"><code class="literal">CREATE ROLE</code></a> and
            <a class="link" href="privileges-provided.html#priv_drop-role"><code class="literal">DROP ROLE</code></a> privileges enable
            only use of the <a class="link" href="create-role.html" title="13.7.1.2 CREATE ROLE Syntax"><code class="literal">CREATE ROLE</code></a>
            and <a class="link" href="drop-role.html" title="13.7.1.4 DROP ROLE Syntax"><code class="literal">DROP ROLE</code></a> statements,
            respectively.
          </p></li><li class="listitem"><p>
            The <a class="link" href="privileges-provided.html#priv_create-user"><code class="literal">CREATE USER</code></a> privilege
            enables use of the <a class="link" href="alter-user.html" title="13.7.1.1 ALTER USER Syntax"><code class="literal">ALTER
            USER</code></a>, <a class="link" href="create-role.html" title="13.7.1.2 CREATE ROLE Syntax"><code class="literal">CREATE ROLE</code></a>,
            <a class="link" href="create-user.html" title="13.7.1.3 CREATE USER Syntax"><code class="literal">CREATE USER</code></a>,
            <a class="link" href="drop-role.html" title="13.7.1.4 DROP ROLE Syntax"><code class="literal">DROP ROLE</code></a>,
            <a class="link" href="drop-user.html" title="13.7.1.5 DROP USER Syntax"><code class="literal">DROP USER</code></a>,
            <a class="link" href="rename-user.html" title="13.7.1.7 RENAME USER Syntax"><code class="literal">RENAME USER</code></a>, and
            <a class="link" href="revoke.html" title="13.7.1.8 REVOKE Syntax"><code class="literal">REVOKE ALL
            PRIVILEGES</code></a> statements.
</p></li></ul>
</div>
<p>
        Thus, the <a class="link" href="privileges-provided.html#priv_create-role"><code class="literal">CREATE ROLE</code></a> and
        <a class="link" href="privileges-provided.html#priv_drop-role"><code class="literal">DROP ROLE</code></a> privileges are not as
        powerful as <a class="link" href="privileges-provided.html#priv_create-user"><code class="literal">CREATE USER</code></a> and may
        be granted to users who should only be permitted to create and
        drop roles, and not perform more general account manipulation.
      </p><p>
        With regard to privileges and interchangeability of users and
        roles, you can treat a user account like a role and grant that
        account to another user or a role. The effect is to grant the
        account's privileges and roles to the other user or role.
      </p><p>
        This set of statements demonstrates that you can grant a user to
        a user, a role to a user, a user to a role, or a role to a role:
      </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">CREATE USER 'u1';
CREATE ROLE 'r1';
GRANT SELECT ON db1.* TO 'u1';
GRANT SELECT ON db2.* TO 'r1';
CREATE USER 'u2';
CREATE ROLE 'r2';
GRANT 'u1', 'r1' TO 'u2';
GRANT 'u1', 'r1' TO 'r2';</code></pre><p>
        The result in each case is to grant to the grantee object the
        privileges associated with the granted object. After executing
        those statements, each of <code class="literal">u2</code> and
        <code class="literal">r2</code> have been granted privileges from a user
        (<code class="literal">u1</code>) and a role (<code class="literal">r1</code>):
      </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">mysql&gt; SHOW GRANTS FOR 'u2' USING 'u1', 'r1';
+-------------------------------------+
| Grants for u2@%                     |
+-------------------------------------+
| GRANT USAGE ON *.* TO `u2`@`%`      |
| GRANT SELECT ON `db1`.* TO `u2`@`%` |
| GRANT SELECT ON `db2`.* TO `u2`@`%` |
| GRANT `u1`@`%`,`r1`@`%` TO `u2`@`%` |
+-------------------------------------+
mysql&gt; SHOW GRANTS FOR 'r2' USING 'u1', 'r1';
+-------------------------------------+
| Grants for r2@%                     |
+-------------------------------------+
| GRANT USAGE ON *.* TO `r2`@`%`      |
| GRANT SELECT ON `db1`.* TO `r2`@`%` |
| GRANT SELECT ON `db2`.* TO `r2`@`%` |
| GRANT `u1`@`%`,`r1`@`%` TO `r2`@`%` |
+-------------------------------------+</code></pre><p>
        The preceding example is illustrative only, but
        interchangeability of user accounts and roles has practical
        application, such as in the following situation: Suppose that a
        legacy application development project began before the advent
        of roles in MySQL, so all user accounts associated with the
        project are granted privileges directly (rather than granted
        privileges by virtue of being granted roles). One of these
        accounts is a developer account that was originally granted
        privileges as follows:
      </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">CREATE USER 'old_app_dev'@'localhost' IDENTIFIED BY 'old_app_devpass';
GRANT ALL ON old_app.* TO 'old_app_dev'@'localhost';</code></pre><p>
        If this developer leaves the project, it becomes necessary to
        assign the privileges to another user, or perhaps multiple users
        if development activies have expanded. Here are some ways to
        deal with the issue:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Without using roles: Change the account password so the
            original developer cannot use it, and have a new developer
            use the account instead:
          </p><pre class="programlisting copytoclipboard line-numbers language-sql one-line"><code class="language-sql">ALTER USER 'old_app_dev'@'localhost' IDENTIFIED BY '<em class="replaceable">new_password</em>';</code></pre></li><li class="listitem"><p>
            Using roles: Lock the account to prevent anyone from using
            it to connect to the server:
          </p><pre class="programlisting copytoclipboard line-numbers language-sql one-line"><code class="language-sql">ALTER USER 'old_app_dev'@'localhost' ACCOUNT LOCK;</code></pre><p>
            Then treat the account as a role. For each developer new to
            the project, create a new account and grant to it the
            original developer account:
          </p><pre class="programlisting copytoclipboard line-numbers language-sql"><code class="language-sql">CREATE USER 'new_app_dev1'@'localhost' IDENTIFIED BY '<em class="replaceable">new_password</em>';
GRANT 'old_app_dev'@'localhost' TO 'new_app_dev1'@'localhost';</code></pre><p>
            The effect is to assign the original developer account
            privileges to the new account.
</p></li></ul>
</div>

</div>

</div>
<br />
        </div>

                <div id="docs-in-page-nav-container">
            <div id="docs-in-page-nav">
                
    <a href="reserved-users.html"
        aria-label="Previous" title="Previous: Reserved Accounts"><span
        class="icon-chevron-left"></span> PREV</a> &nbsp;
<a href="index.html" aria-label="Start" title="Start"> HOME</a> &nbsp;
        <a aria-label="Up" href="access-control.html" title="Up: Access Control and Account Management"> UP</a> &nbsp;
    <a href="account-categories.html" aria-label="Next"
        title="Next: Account Categories">NEXT <span
        class="icon-chevron-right"></span></a>
            </div>
        </div>
        
         <div id="docs-body-extra">
             
<a class="docs-sidebar-section" href=""><span class="icon-related"></span>
    <span class="text">Related Documentation</span></a>
<div class="docs-sidebar-accordian">
    <div class="text">
        <a href="/doc/relnotes/mysql/8.0/en/">MySQL 8.0 Release Notes</a><br />
        <a href="/doc/dev/mysql-server/latest/">MySQL 8.0 Source Code Documentation</a><br />
        </div>
</div>

    <a class="docs-sidebar-section" href=""><span class="icon-download-thin"></span>
        <span class="text">
            Download
                            this Manual
                    </span>
    </a>
    <div class="docs-sidebar-accordian">
        <div class="text">
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.pdf">PDF (US Ltr)</a>
            - 46.1Mb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.a4.pdf">PDF (A4)</a>
            - 46.1Mb<br />
                        <a href="https://downloads.mysql.com/docs/mysql-ref-manual-8.0-en-pdf-1-20190611.noarch.rpm">PDF (RPM)</a>
            - 41.5Mb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.html-chapter.tar.gz">HTML Download (TGZ)</a>
            - 10.6Mb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.html-chapter.zip">HTML Download (Zip)</a>
            - 10.6Mb<br />
                        <a href="https://downloads.mysql.com/docs/mysql-ref-manual-8.0-en-html-chapter-1-20190611.noarch.rpm">HTML Download (RPM)</a>
            - 9.1Mb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.man-gpl.tar.gz">Man Pages (TGZ)</a>
            - 220.4Kb<br />
                        <a href="https://downloads.mysql.com/docs/refman-8.0-en.man-gpl.zip">Man Pages (Zip)</a>
            - 325.8Kb<br />
                        <a href="https://downloads.mysql.com/docs/mysql-8.0.info.gz">Info (Gzip)</a>
            - 4.1Mb<br />
                        <a href="https://downloads.mysql.com/docs/mysql-8.0.info.zip">Info (Zip)</a>
            - 4.1Mb<br />
                    </div>
    </div>

<a class="docs-sidebar-section" href=""><span class="icon-book"></span>
    <span class="text">Excerpts from this Manual</span></a>
<div class="docs-sidebar-accordian">
    <div class="text">
                <a href="/doc/mysql-backup-excerpt/8.0/en/">MySQL Backup and Recovery</a><br />
                <a href="/doc/mysql-g11n-excerpt/8.0/en/">MySQL Globalization</a><br />
                <a href="/doc/mysql-infoschema-excerpt/8.0/en/">MySQL Information Schema</a><br />
                <a href="/doc/mysql-installation-excerpt/8.0/en/">MySQL Installation Guide</a><br />
                <a href="/doc/mysql-security-excerpt/8.0/en/">Security in MySQL</a><br />
                <a href="/doc/mysql-startstop-excerpt/8.0/en/">Starting and Stopping MySQL</a><br />
                <a href="/doc/mysql-linuxunix-excerpt/8.0/en/">MySQL and Linux/Unix</a><br />
                <a href="/doc/mysql-windows-excerpt/8.0/en/">MySQL and Windows</a><br />
                <a href="/doc/mysql-osx-excerpt/8.0/en/">MySQL and OS X</a><br />
                <a href="/doc/mysql-solaris-excerpt/8.0/en/">MySQL and Solaris</a><br />
                <a href="/doc/mysql-sourcebuild-excerpt/8.0/en/">Building MySQL from Source</a><br />
                <a href="/doc/mysql-reslimits-excerpt/8.0/en/">MySQL Restrictions and Limitations</a><br />
                <a href="/doc/mysql-partitioning-excerpt/8.0/en/">MySQL Partitioning</a><br />
                <a href="/doc/mysql-secure-deployment-guide/8.0/en/">MySQL Secure Deployment Guide</a><br />
                <a href="/doc/mysql-tutorial-excerpt/8.0/en/">MySQL Tutorial</a><br />
                <a href="/doc/mysql-perfschema-excerpt/8.0/en/">MySQL Performance Schema</a><br />
                <a href="/doc/mysql-replication-excerpt/8.0/en/">MySQL Replication</a><br />
                <a href="/doc/mysql-repo-excerpt/8.0/en/">Using the MySQL Yum Repository</a><br />
            </div>
</div>
         </div>

              </div>
     </div>

</div>

<script>
$(function() {
    var doc = new $.doc({ 'mobile': $.browser.mobile, 'docId': 1, 'highlight': true });
});
</script>
    

            
        </div>
    </div>

    <footer class="collapsed">
        <div id="footer-bottom">
                                    <div id="footer-collapse">
                <a href="" id="expand-footer"
                    aria-label="Expand Footer"
                    title="Expand Footer"><span
                    class="icon-plus-square"></span></a>
            </div>
                        <div class="footer-contact">
                <div id="footer-contact-icon" style="display: none;">
                    <span class="icon-call-phone"></span>
                </div>
                <div id="footer-contact-numbers" style="display: none;">
                    <strong>Contact MySQL Sales</strong><br/>
                    USA/Canada: +1-866-221-0634 &nbsp;
                    (<a href="https://www.mysql.com/about/contact/phone/">More Countries &raquo;</a>)
                </div>
                <div id="footer-contact-copyright" style="display: inline-block;">
                    <a href="http://www.oracle.com/" aria-label="Oracle" title="Oracle"><span class="oracle-logo"></span></a>
                    &nbsp; &copy; 2019, Oracle Corporation and/or its affiliates
                </div>
            </div>
            <div class="social-icons">
                <a aria-label="Join us on Facebook" title="Join us on Facebook" href="http://www.facebook.com/mysql"><span class="icon-facebook-square"></span></a>
                <a aria-label="Follow us on Twitter" title="Follow us on Twitter" href="https://twitter.com/mysql"><span class="icon-twitter-square"></span></a>
                <a aria-label="Follow us on LinkedIn" title="Follow us on LinkedIn" href="https://www.linkedin.com/company/mysql"><span class="icon-linkedin-square"></span></a>
                <a aria-label="Visit our YouTube channel" title="Visit our YouTube channel" href="http://www.youtube.com/mysqlchannel"><span class="icon-youtube-square"></span></a>
            </div>
            <br class="clear" />
        </div>
        <div id="footer-links">

            <div id="footer-nav"></div>

            <div class="links">
                <ul>
                    <li class="top"><a href="https://www.mysql.com/products/">Products</a></li>
                    <li><a href="https://www.mysql.com/cloud/">Oracle MySQL Cloud Service</a></li>
                    <li><a href="https://www.mysql.com/products/enterprise/">MySQL Enterprise Edition</a></li>
                    <li><a href="https://www.mysql.com/products/standard/">MySQL Standard Edition</a></li>
                    <li><a href="https://www.mysql.com/products/classic/">MySQL Classic Edition</a></li>
                    <li><a href="https://www.mysql.com/products/cluster/">MySQL Cluster CGE</a></li>
                    <li><a href="https://www.mysql.com/oem/">MySQL Embedded (OEM/ISV)</a></li>
                </ul>
            </div>

            <div class="links">
                <ul>
                    <li class="top"><a href="https://www.mysql.com/services/">Services</a></li>
                    <li><a href="https://www.mysql.com/training/">Training</a></li>
                    <li><a href="https://www.mysql.com/certification/">Certification</a></li>
                    <li><a href="https://www.mysql.com/consulting/">Consulting</a></li>
                    <li><a href="https://www.mysql.com/support/">Support</a></li>
                </ul>
            </div>

            <div class="links">
                <ul>
                    <li class="top"><a href="https://dev.mysql.com/downloads/">Downloads</a></li>
                    <li><a href="https://dev.mysql.com/downloads/mysql/">MySQL Community Server</a></li>
                    <li><a href="https://dev.mysql.com/downloads/cluster/">MySQL NDB Cluster</a></li>
                    <li><a href="https://dev.mysql.com/downloads/shell/">MySQL Shell</a></li>
                    <li><a href="https://dev.mysql.com/downloads/router/">MySQL Router</a></li>
                    <li><a href="https://dev.mysql.com/downloads/workbench/">MySQL Workbench</a></li>
                </ul>
            </div>

            <div class="links">
                <ul>
                    <li class="top"><a href="https://dev.mysql.com/doc/">Documentation</a></li>
                    <li><a href="https://dev.mysql.com/doc/refman/en/">MySQL Reference Manual</a></li>
                    <li><a href="https://dev.mysql.com/doc/workbench/en/">MySQL Workbench</a></li>
                    <li><a href="https://dev.mysql.com/doc/index-cluster.html">MySQL NDB Cluster</a></li>
                    <li><a href="https://dev.mysql.com/doc/index-connectors.html">MySQL Connectors</a></li>
                    <li><a href="https://dev.mysql.com/doc/#topic">Topic Guides</a></li>
                </ul>
            </div>

            <div class="links">
                <ul>
                    <li class="top"><a href="https://www.mysql.com/about/">About MySQL</a></li>
                    <li><a href="https://www.mysql.com/about/contact/">Contact Us</a></li>
                                                            <li><a href="https://www.mysql.com/buy-mysql/">How to Buy</a></li>
                    <li><a href="https://www.mysql.com/partners/">Partners</a></li>
                    <li><a href="https://www.mysql.com/about/jobs/">Job Opportunities</a></li>
                    <li><a href="https://www.mysql.com/sitemap.html">Site Map</a></li>
                </ul>
            </div>

            
            <div id="footer-logo">
                <a href="http://www.oracle.com/" aria-label="Oracle" title="Oracle"><span class="oracle-logo"></span></a>
                &nbsp; &copy; 2019, Oracle Corporation and/or its affiliates
                <div class="footer-legal-links">
                    <a href="https://www.mysql.com/about/legal/">Legal Policies</a> |
                    <a href="http://www.oracle.com/us/legal/privacy/index.htm">Your Privacy Rights</a> |
                    <a href="http://www.oracle.com/us/legal/terms/index.html">Terms of Use</a> |
                    <a href="http://www.oracle.com/us/legal/third-party-trademarks/index.html">Trademark Policy</a> |
                    <a href="http://www.oracle.com/technetwork/community/oca-486395.html">Contributor Agreement</a> |
                    <div id="teconsent" style="display: inline-block"><script async="async" type="text/javascript" src="js/notice.js" crossorigin=""></script></div>
                </div>
            </div>

        </div>
    </footer>
</div>

        <script src="js/s_code_remote.js"></script>

        
    
</body>
</html>
